import java.io.IOException;

public class Main{

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		java.io.BufferedReader r = new java.io.BufferedReader(
				new java.io.InputStreamReader(System.in));

		int number = -1;
		int[] loveMobiles;
		while (true) {
			number = Integer.parseInt(r.readLine());
			if (number == 0) {
				break;
			} else {
				loveMobiles = new int[number];
				String[] s = (r.readLine().trim()).split(" ");
				for (int i = 0; i < loveMobiles.length; i++) {
					loveMobiles[i] = Integer.parseInt(s[i]);
				}
				String result = "yes";
				int fnum = -1;
				boolean found = false;
				int i = 0;
				for (; i < loveMobiles.length; i++) {
					if (i+1 != loveMobiles[i]) {
						fnum = loveMobiles[i];
						found = true;
						break;
					}
				}
				if (found) {
					for (; i < fnum; i++) {
						if (fnum < loveMobiles[i]) {
							result = "no";
							break;
						}
					}
				}
				System.out.println(result);
			}
		}
	}
}
